package interfaz;

import java.awt.Dimension;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.UIManager.LookAndFeelInfo;


public class Ventana extends JFrame{

	private JPanel panel;

	public Ventana(){
		this.setVisible(true);
		setSize(800,600);
		this.setPreferredSize(new Dimension (800,600));
		setResizable(false);	
		this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
		this.setLocationRelativeTo(null);

		pack();

		try {
			for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
				if ("Nimbus".equals(info.getName())) {
					UIManager.setLookAndFeel(info.getClassName());
					System.out.println("SI Nimbus");
					break;
				}
			}
		} catch (Exception e) {
			// If Nimbus is not available, you can set the GUI to another look and feel.
			System.out.println("No Nimbus");
		}		


	}

	public JPanel getPanel(){
		return panel;
	}

	public void setPanel(JPanel p){
		panel.setVisible(false);
		p.setVisible(true);
		panel = p;
	}


}
